<template>
  <div>
      <van-nav-bar class="app-nav-bar" title="任务详情页" left-arrow @click-left="back"/>
        <van-cell class="mb-4" title="任务名称" :value="tableData.taskName" />
        <van-cell class="mb-4" title="任务类型" :value="tableData.taskType" />
        <van-cell class="mb-4" title="任务状态" :value="tableData.taskStatus" />
        <van-cell class="mb-4" title="排班时间" :value="as" />
        <van-cell class="mb-4" title="作业内容" :value="tableData.taskContent" />
        <van-cell class="mb-4" title="创建时间" :value="tableData.createTime" />
  </div>
</template>

<script>
export default {
    data(){
        return{
            tableData:[],
            as:""
        }
    },
    methods:{
        back(){
            this.$router.go(-1) 
        },
        async getUser(){
            var {data:res} =await this.request.get('/app/Task/getTaskById?id='+this.$route.params.id)
            // console.log(res);
            this.tableData=res.data;
            var ss=this.tableData.startDate;
            var ll=this.tableData.endDate;
            this.as=ss+" 至 "+ll
            console.log(this.tableData);
        },
    },created(){
        this.getUser();
    }
}
</script>

<style lang="scss">
.mb-4{
  margin-bottom: 4px !important;
}
</style>